package com.hp.service;

import com.hp.bean.Coupon;
import com.hp.mapper.CouponMapper;
import com.hp.util.DataUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CouponServiceImp implements CouponService {
    @Resource
    private CouponMapper mapper;
    @Override
    public Coupon selectCouponById(Integer id) {
        return mapper.selectCouponById(id);
    }

    @Override
    public List<Coupon> selectCouponList(Coupon coupon) {
        return mapper.selectCouponList(coupon);
    }

    @Override
    public int insertCoupon(Coupon coupon) {
        return mapper.insertCoupon(coupon);
    }

    @Override
    public int updateCoupon(Coupon coupon) {
        return mapper.updateCoupon(coupon);
    }

    @Override
    public int delCouponById(Integer id) {
        return mapper.delCouponById(id);
    }

    @Override
    public int delCouponByIds(String ids) {
        return mapper.delCouponByIds(DataUtils.toStrArray(ids));
    }

    @Override
    public List<Coupon> selectListByPhone(String phone) {
        return mapper.selectListByPhone(phone);
    }
}
